package com.yuhanginfo.modules.sys.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuhanginfo.common.persistence.Page;
import com.yuhanginfo.common.service.CrudService;
import com.yuhanginfo.modules.sys.dao.UserEditHistroyDao;
import com.yuhanginfo.modules.sys.entity.UserEditHistroy;

/**
 * 会员操作历史Service
 * @author lvls
 * @version 2017-09-21
 */
@Service
@Transactional(readOnly = true)
public class UserEditHistroyService extends CrudService<UserEditHistroyDao, UserEditHistroy> {

	@Autowired
	private UserEditHistroyDao userEditHistroyDao;
	
	
	
	@Transactional(readOnly = false)
	public void save(UserEditHistroy userEditHistroy) {
		super.save(userEditHistroy);
	}
	
	@Transactional(readOnly = false)
	public void delete(UserEditHistroy userEditHistroy) {
		super.delete(userEditHistroy);
	}

	/**
	 * 通过会员id查询额度调整历史记录
	 * @param page
	 * @param entity
	 * @return
	 */
	public Page<UserEditHistroy> selectUserEditHistroyOnCreditByUserId(Page<UserEditHistroy> page,UserEditHistroy entity) {
		entity.setPage(page);
		page.setList(userEditHistroyDao.selectUserEditHistroyOnCreditByUserId(entity));
		return page;
	}
	/**
	 * 通过会员id查询门店设置历史记录
	 * @param page
	 * @param entity
	 * @return
	 */
	public Page<UserEditHistroy> selectUserEditHistroyOnStoreByUserId(Page<UserEditHistroy> page,UserEditHistroy entity) {
		entity.setPage(page);
		page.setList(userEditHistroyDao.selectUserEditHistroyOnStoreByUserId(entity));
		return page;
	}
	
}